#region License

// This file is part of Grawlix.
// 
// Grawlix is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
// Grawlix is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public
// License along with Grawlix.  If not, see
// <http://www.gnu.org/licenses/>.

#endregion

using System;
using System.IO;

namespace Grawlix.Services.Resources
{
	/// <summary>
	/// A service that resolves URIs into typed resource.
	/// </summary>
	/// <typeparam name="T">The type of resource that is resolved.
	/// </typeparam>
	public interface ITypedResolver<T>
	{
		/// <summary>
		/// Loads a typed resource by its URI.
		/// </summary>
		/// <param name="uri">The uri that identifies the typed
		/// resource.</param>
		/// <returns>The typed resource found.</returns>
		/// <exception cref="IOException">A generic I/O error occurred.
		/// </exception>
		/// <exception cref="FileNotFoundException">The URI could not
		/// be resolved or is of the wrong type.
		/// </exception>
		/// <remarks>This is a blocking operation which should only be
		/// called asynchronously.</remarks>
		T Load(Uri uri);
	}
}